<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>实现全选复选框问题</title>
	<script src="jquery.min.js"></script>
	<script src="https://code.angularjs.org/1.2.15/angular.min.js"></script>
</head>
<body ng-app="myApp">
	<div ng-controller="mainCtrl">
		<label>全选<input type="checkbox" ng-model="selectAll" ng-click="all(selectAll)"></label><br/>
		<div ng-repeat="person in persons">
			<label>{{person.name}}:<input type="checkbox" ng-checked="selectAll" ng-model="person.state"> </label><br/>
		</div>

		<div>selectAll : {{selectAll}}</div>
		<div ng-repeat="person in persons">
			{{person.name}} : {{person.state}}
		</div>
	</div>
<script src="checkbox.js"></script>
</body>
</html>